﻿// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone

using PetaPoco;

namespace BlazorAdmin.Services.DbService
{
    /// <summary>
    /// 
    /// </summary>
    public interface IPetaPoco
    {
        /// <summary>
        /// 创建数据库连接实例
        /// </summary>
        /// <returns></returns>
        IDatabase Create(bool keepAlive = false);

        /// <summary>
        /// 创建数据库连接实例
        /// </summary>
        /// <param name="connName">连接字符串</param>
        /// <param name="keepAlive">是否保持连接活跃状态，使用完成后不立即关闭连接或释放资源</param>
        /// <returns></returns>
        IDatabase Create(string connName, bool keepAlive = false);
    }
}